#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
#include<numeric>

class Solution {
public:
    int missingNumber(vector<int>& nums) {
        int sum = accumulate(nums.begin(),nums.end(),0);
        return 0.5*(nums.size()+1)*(nums.size())-sum;
    }
};

int main(){
    vector<int> V = {0,1,3};
    Solution S;
    cout<<S.missingNumber(V)<<endl;
}